home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act6a / 00417.ls < prev    next >
Encoding:
Text File  |  1995-03-28  |  2.6 KB  |  100 lines

  1. on keyDown
  2.   global partnum, TxtCursor, changer, takeinput, castnumber, firstcursor
  3.   if takeinput = 0 then
  4.     exit
  5.   end if
  6.   set tensdigit to 21 + ((partnum - 1) * 2)
  7.   set onesdigit to 22 + ((partnum - 1) * 2)
  8.   if (the key = "w") and the optionDown then
  9.     stopMovie()
  10.   end if
  11.   if the number of chars in changer < 2 then
  12.     if (the key >= "0") and (the key <= "9") then
  13.       set changer to changer & the key
  14.     end if
  15.   end if
  16.   if (the key = RETURN) or (the key = ENTER) then
  17.     if char 2 of changer = EMPTY then
  18.       set the castNum of sprite onesdigit to getAt(castnumber, 12)
  19.       set TxtCursor to 0
  20.     end if
  21.     if takeinput = 2 then
  22.       set takeinput to 3
  23.       exit
  24.     end if
  25.     if value(changer) = 0 then
  26.       exit
  27.     end if
  28.     checkit()
  29.   else
  30.     if the key = BACKSPACE then
  31.       set monkey to changer
  32.       if the number of chars in monkey > 1 then
  33.         set monkey to char 1 to the number of chars in monkey - 1 of monkey
  34.         set changer to monkey
  35.       else
  36.         set changer to EMPTY
  37.       end if
  38.     end if
  39.     set holdchar1 to char 1 of changer
  40.     set holdchar2 to char 2 of changer
  41.     if holdchar1 = EMPTY then
  42.       set the castNum of sprite onesdigit to getAt(castnumber, 12)
  43.       set the castNum of sprite tensdigit to getAt(castnumber, 12)
  44.       set TxtCursor to tensdigit
  45.     else
  46.       set the castNum of sprite tensdigit to getAt(castnumber, 1 + value(holdchar1))
  47.       if holdchar2 = EMPTY then
  48.         set TxtCursor to onesdigit
  49.         set the castNum of sprite onesdigit to getAt(castnumber, 12)
  50.       else
  51.         set the castNum of sprite onesdigit to getAt(castnumber, 1 + value(holdchar2))
  52.         set TxtCursor to 0
  53.       end if
  54.     end if
  55.   end if
  56.   if TxtCursor > 0 then
  57.     set the castNum of sprite TxtCursor to firstcursor
  58.   end if
  59.   updateStage()
  60. end
  61.  
  62. on RotateCursor
  63.   global TxtCursor, lastcursor, firstcursor
  64.   if the castNum of sprite TxtCursor > 0 then
  65.     set mycast to the castNum of sprite TxtCursor
  66.     if mycast = lastcursor then
  67.       set the castNum of sprite TxtCursor to firstcursor
  68.     else
  69.       set the castNum of sprite TxtCursor to 1 + the castNum of sprite TxtCursor
  70.     end if
  71.     updateStage()
  72.   end if
  73. end
  74.  
  75. on moveyes
  76.   global bugeyesx, bugeyesy, eyerange
  77.   set eyegore to eyerange / 2
  78.   set mh to the mouseH
  79.   set mv to the mouseV
  80.   if mh > 640 then
  81.     set mh to 640
  82.   end if
  83.   if mh < 0 then
  84.     set mh to 0
  85.   end if
  86.   if mv > 480 then
  87.     set mv to 480
  88.   end if
  89.   if mv < 0 then
  90.     set mv to 0
  91.   end if
  92.   set mh to bugeyesx - ((bugeyesx - mh) / eyerange)
  93.   set mv to bugeyesy - ((bugeyesy - mv) / eyerange)
  94.   set the locH of sprite 19 to mh
  95.   set the locV of sprite 19 to mv
  96. end
  97.  
  98. on sodit
  99. end
  100.